﻿using System;
using System.Collections.Generic;
using System.Threading;
using System.Linq;
using System.Xml.Linq;
using System.Diagnostics;
using System.IO;
using System.Xml;
using System.ComponentModel;
using System.Data;
using System.Text;
using System.Media;
using System.Net;
using System.Globalization;

using Styx;
using Styx.Common;
using Styx.CommonBot;
using Styx.Helpers;
using Styx.WoWInternals;
using Styx.WoWInternals.WoWObjects;
using Styx.Plugins;
namespace Attacker
{
    public class Autoattack: HBPlugin
    {
        public override string Name
        {
            get { return "AutoAttacker"; }
        }

        public override string Author
        {
            get { return "Stove"; }
        }

        public override Version Version
        {
            get { return new Version(0, 1); }
        }
        public static LocalPlayer Me = StyxWoW.Me;
        public override void Pulse()
        {
            if (!Me.Combat) return;
            if (!Me.IsFacing(Me.CurrentTarget))
            {
                Logging.Write("Facing target");
                Me.Face();
            }
            if(Me.CurrentTarget.IsDead)
            {
                Logging.Write("Clearing target");
                Me.ClearTarget();
            }
            if (!Me.IsAutoAttacking)
            {
                Logging.Write("Autoattacking!");
                Me.ToggleAttack();
            }
        }


    }
}
